﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using Ajax.Common;

namespace Ajax.Web.Control
{
	public partial class Top : System.Web.UI.UserControl
	{
		protected internal Ajax.Model.WebSet webset;
		protected void Page_Load(object sender, EventArgs e)
		{
			// 读取缓存
			if (HttpRuntime.Cache["WebSet"] != null)
			{
				webset = (Ajax.Model.WebSet)MyCache.ReadCache("WebSet");
			}
			else
			{
				webset = new Ajax.BLL.WebSet().loadConfig(Server.MapPath(ConfigurationManager.AppSettings["Configpath"].ToString()));
			}

			// 添加到缓存
			if (HttpRuntime.Cache["WebSet"] == null)
			{
				MyCache.InsertCache("WebSet", webset, 86400);
			}
		}
	}
}